<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script language="javascript" type="text/javascript">

$(document).ready(function(){
		$.post("../whitherJson!returnCountryCode.action",{"name":"CN"},function(data){
			var pro = document.getElementById("proNum");
				$(data.provinces).each(function(){
					pro.options.add(new Option(this.clinentProvinceName,this.clinentProvinceNumber));
				})
		});
		
		
		$("#proNum").change(function(){
		var cit = document.getElementById("startLocal");
//		var arry = new Array();
			cit.options.length = 1;
			$.post("../whitherJson!findCitys.action",{"proNumber":this.value},function(data){
				$(data.citys).each(function(){
					cit.options.add(new Option(this.clinentCityName,this.clinentCityNumber));
//					arry.push([this.clinentCityNumber,this.clinentCityName]);
				});
//				return arry;
			});

	});
	
	$.post("<%=basePath%>queryPrice_getCountrys.action",{"q_name":""},function(data){
			var pro = document.getElementById("end_Local");
			pro.options.length = 1;
				$(data.allCountrys).each(function(){
					pro.options.add(new Option(this.clinentCountryCn,this.clinentCountryCode));
				})
		});
	
	$("#endLocal").change(function(){
		$.post("<%=basePath%>queryPrice_getCountrys.action",{"q_name":this.value},function(data){
			var pro = document.getElementById("end_Local");
			pro.options.length = 1;
				$(data.allCountrys).each(function(){
					pro.options.add(new Option(this.clinentCountryCn,this.clinentCountryCode));
				})
		});
	});



	});


	function aa(){
		asyncbox.open({
			url : "<%=basePath%>queryPrice_loadCitysAndprovinces.action",
			width : 1000,
			height : 540,
			top : 40,
			drag : false,
			modal : true,
			scrolling : "yes",
			title : "城市列表",
			tipsbar : {
				title : '请选择一个',
				content : '城市'
			},
			btnsbar : $.btn.OKCANCEL,
			callback : function(action,iframe,returnValue){
				if(action == 'ok'){
					var strs = returnValue.split(",");
					$("#startLocal").attr("value",strs[0]);
					$("#startLocalName").attr("value",strs[1]);
				}else{
					
				}
			}
		});
	}
	
	
	
		/*点击单选按钮触发层的显示或隐藏*/
function selectMode(id){
 
	  if(id == 1){
	  	var timberDiv = document.getElementById("timberWeight");
	  	var timberCJDiv = document.getElementById("timberWeightCJ");
	  	var goodsTypeDiv = document.getElementById("goodsType");
	  	
	  	var timberWeightC = document.getElementById("timberWeightC");
	  	var timberWeightK = document.getElementById("timberWeightK");
	  	var timberWeightG = document.getElementById("timberWeightG");
	  	
	  	timberWeightC.className = "required number";
	  	timberWeightK.className = "required number";
	  	timberWeightG.className = "required number";
	  	
   		timberDiv.style.display="block";
   		timberCJDiv.style.display="block";
   		goodsTypeDiv.style.display="block";
   		
	}
	  if(id == 0){
	  	var timberDiv = document.getElementById("timberWeight");
	  	var timberCJDiv = document.getElementById("timberWeightCJ");
	  	var goodsTypeDiv = document.getElementById("goodsType");
	  	
	  	var timberWeightC = document.getElementById("timberWeightC");
	  	var timberWeightK = document.getElementById("timberWeightK");
	  	var timberWeightG = document.getElementById("timberWeightG");
	  	
	  	timberWeightC.className = "";
	  	timberWeightK.className = "";
	  	timberWeightG.className = "";
	  	
   		timberDiv.style.display="none";
   		timberCJDiv.style.display="none";
   		goodsTypeDiv.style.display="none";
   		
	}
	
  return;
  }
</script>
<form id="pagerForm" method="post" action=""> <!-- 此action指定的是排序、分页所提交的action -->
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
</form>


<div class="pageHeader">
	<form class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)" action="<%=basePath%>queryPrice_queryPrice.action" method="post">
	<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input name="qp" type="radio" onclick="selectMode(0)" checked="checked"/>小包
		<input name="qp" type="radio" onclick="selectMode(1)"/>国际件
		<input name="qp" type="radio"/>国内物流
		<input name="qp" type="radio"/>空运
		<input name="qp" type="radio"/>海运
	</div>
	<input type="hidden" name="remote.PChannelNumber" value="${requestScope.map.channelNumber }" />
		<div id="xiaobao" class="searchBar">
				<div class="pageFormContent1">
				    <p>
				        <label> 起始地：</label>
					<select id="proNum" name="proNum" class="required">
						<option value="" selected>请选择省:</option>
					</select>
					</P>
					<p>
					<select id="startLocal" name="startLocal" class="required">
						<option value="" selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请选择市:</option>
					</select>
					</p>
					<p>
					<label>目的地：</label>
					<input alt="输入国家编码或中英名" type="text" id="endLocal" name="" class="" size=""/>
					</p>
					<p>
					<select id="end_Local" name="endLocal" class="required">
						<option value="" selected>请选择目的地:</option>
					</select>
					</p>
					<p>
					<label>实重：</label>
					<input type="text" name="actualWeight" class="required number"/>
				    </p>
				    <p id="timberWeight" style="display: none;">
					<label>材重：</label>
					<input id="timberWeightC" type="text" name="timberWeightC" size="1" />*
					<input id="timberWeightK" type="text" name="timberWeightK" size="1" />*
					<input id="timberWeightG" type="text" name="timberWeightG" size="1" />
					</p>
					<p id="timberWeightCJ" style="display: none;">
					<label>材积计算：</label>
					<select name="timberWeightCJ" class="combox">
					<option value="5000">5000</option>
					<option value="6000">6000</option>
					</select>
					</p>
					<p> 
					<label>客户编码：</label>
					<input type="text" name="stPartition" size="13" />
					<input type="button" value="..." onclick="aa()" />
					</p>
					<p>
					<label>客户类别：</label>
					<select name="clientType" class=" combox">
					<option value="" selected>全部</option>
					<c:forEach items="${clientClasses}" var="clientClasse">
						<option id="" value="${clientClasse.classNumber}">${clientClasse.className}</option>	
					</c:forEach>
					</select>
					</p>
					<p id="goodsType" style="display: none;">
					<label>货物类型：</label>
					<select name="goodsType" class=" combox">
					<option value="" selected>全部</option>
					<option value="WPX">文件</option>
					<option value="DOC">包裹</option>
					</select>
					</p>
				</div>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">&nbsp;&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;&nbsp;</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" width="1900" layoutH="190">
		<thead>
			<tr>
				<th width="" orderField="accountNo" class="asc">客户类别</th>
				<th width="" orderField="accountNo" class="asc">渠道名称</th>
				<th width="" orderField="accountNo" class="asc">渠道别名</th>
				<th width=""orderField="accountNo" class="asc">起始分区名</th>
				<th width=""orderField="accountNo" class="asc">目的分区名</th>
				<th width=""orderField="accountNo" class="asc">货物类型</th>
				<th width=""orderField="accountNo" class="asc">结算重量(kg)</th>
				<th width=""orderField="accountNo" class="asc">最低重量(kg)</th>
				<th width=""orderField="accountNo" class="asc">最高重量(kg)</th>
				<th width=""orderField="accountNo" class="asc">计算公式1</th>
				<th width=""orderField="accountNo" class="asc">计算公式2</th>
				<th width=""orderField="accountNo" class="asc">折扣</th>
				<th width=""orderField="accountNo" class="asc">燃油</th>
				<th width=""orderField="accountNo" class="asc">金额</th>
				<th width=""orderField="accountNo" class="asc">递送时间(天)</th>
				<th width=""orderField="accountNo" class="asc">更新日期</th>
				<th width=""orderField="accountNo" class="asc">说明</th>
			</tr>
		</thead>
		<tbody>
		   <c:forEach items="${queryPriceBeans}" var="queryPriceBean">
		   		<tr target="sid_user" rel="1">
					<td>${queryPriceBean.qClassName}</td>
					<td>${queryPriceBean.qPChannelName}</td>
					<td>${queryPriceBean.qPChannelAlias}</td>
					<td>${queryPriceBean.qPSPartitionName}</td>
					<td>${queryPriceBean.qPEPartitionName}</td>
					<td>
						<c:if test="${queryPriceBean.qPPriceGoodsClass == 'WPX'}">
							文件
						</c:if>
						<c:if test="${queryPriceBean.qPPriceGoodsClass == 'DOC'}">
							包裹
						</c:if>
					</td>
					<td>${queryPriceBean.qSettlementWeight}</td>
					<td>${queryPriceBean.qPPriceSWeight}</td>
					<td>${queryPriceBean.qPPriceBWeight}</td>
					<td>${queryPriceBean.qPPriceFormula1}</td>
					<td>${queryPriceBean.qPPriceFormula2}</td>
					<td>${queryPriceBean.qPDiscountRate}</td>
					<td>${queryPriceBean.qPFuelCost}</td>
					<td>${queryPriceBean.qCost}</td>
					<td>${queryPriceBean.qPChannelSpeedTime}</td>
					<td>${queryPriceBean.qPPriceAddDate}</td>
					<td>${queryPriceBean.qPPriceNote}</td>
			</tr>
		   </c:forEach>
			
		</tbody>
	</table>
</div>